//
//  CheckPermissionUtil.h
//  PeachDoctor
//
//  Created by ui on 2019/10/14.
//  Copyright © 2019 四川睡呗科技有限公司. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <AVFoundation/AVFoundation.h>

NS_ASSUME_NONNULL_BEGIN

typedef enum : NSUInteger {
    ZFJCheckDataRestricted,
    ZFJCheckPhotoLibrary,
    ZFJCheckCamera,
    ZFJCheckLocation,
    ZFJCheckNotification,
    ZFJCheckAudio,
    ZFJCheckAddressBook,
    ZFJCheckCalendars,
    ZFJCheckReminders,
    
}ZFJCheckPermissionType;

typedef enum : NSUInteger {
    ZFJStatusDenied,
    ZFJStatusAuthorized,
    ZFJStatusUnknown,
    ZFJStatusRestricted,
    ZFJStatusNotDetermined,
    ZFJStatusAuthorizedAlways,
    ZFJStatusAuthorizedWhenInUse,
}ZFJCheckResultType;

@interface PeachPermissionUtil : NSObject

/**
 请求设备权限授权
 
 @param mediaType 设备类型
 @param successBlock 成功回调
 @param failtureBlock 失败回调
 */
+ (void)requestCaptureAuthorizationByMediaType:(AVMediaType)mediaType
                                  successBlock:(void(^)(void))successBlock failture:(void(^)(void))failtureBlock;

/**
 检查APP权限

 @param permissionType 要检查的权限类型
 @param completed 结果回调(FIRST:6 2 2 2 2 2 2 2 0)
 */
- (void)checkUpAPPPermission:(ZFJCheckPermissionType)permissionType completed:(void(^)(ZFJCheckResultType authStatus))completed;

/**
 请求权限

 @param permissionType 要请求的权限类型
 @param completed 结果回调
 */
- (void)requestAccessPermission:(ZFJCheckPermissionType)permissionType completed:(void(^)(BOOL isScu))completed;

/**
 跳转到设置APP页面
 */
- (void)jumpToAPPSetting;

/**
 用户拒绝访问权限,我们需要提醒用户打开访问开关

 @param meg 提示文字
 */
- (void)showStatusDeniedMeg:(NSString *)meg;

@end

NS_ASSUME_NONNULL_END
